import { pubRequire } from '@utils/public'
const baseUrl = '/activities/posters-introductions'
//海报转介绍列表
export function getPostActiveList(params, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, params, callbBack, errBack)
}
//海报转介绍开始
export function startPoster(id, callbBack, errBack) {
  return pubRequire('patch', `${baseUrl}/${id}/start`, '', callbBack, errBack)
}
//海报转介绍删除
export function deletePoster(id, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, '', callbBack, errBack)
}
//海报转介绍结束
export function endPoster(id, callbBack, errBack) {
  return pubRequire('patch', `${baseUrl}/${id}/end`, '', callbBack, errBack)
}
// 新增转介绍活动
export function addPoster(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
// 修改转介绍活动
export function changePoster(id, obj, sucBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}`, obj, sucBack, errBack)
}
// 根据id查询活动详情
export function getPosterDetail(id, obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}`, '', callbBack, errBack)
}
// 海报转介绍验证名称是否存在
export function getPostersName(name, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/validation/name-existence?name=${name}`,
    '',
    callbBack,
    errBack
  )
}
/////////////////////////////////////////////////////////////////
const base = '/activities'
//活动下拉数据
export function getActivityList(callBack, errBack) {
  return pubRequire(
    'get',
    `${base}/collections-likes/activities-names`,
    {},
    callBack,
    errBack
  )
}
//集赞列表-获取活动下拉数据
export function getActivitiesNameList(callBack, errBack) {
  return pubRequire(
    'get',
    `${base}/collections-likes/activities-names`,
    {},
    callBack,
    errBack
  )
}
//集赞列表-根据条件查询活动列表
export function getCollectPraiseList(params, callBack, errBack) {
  return pubRequire(
    'get',
    `${base}/collections-likes`,
    params,
    callBack,
    errBack
  )
}
//集赞列表-查看详情
export function getCollectLikesInfo(params, callBack, errBack) {
  return pubRequire(
    'get',
    `${base}/collections-likes/info`,
    params,
    callBack,
    errBack
  )
}
//集赞列表-根据id查询数据统计
export function getCollectLikesdata(activityId, {}, callBack, errBack) {
  return pubRequire(
    'get',
    `${base}/collections-likes/data/${activityId}`,
    {},
    callBack,
    errBack
  )
}
//审核通过
export function reviewedPass(id, callBack, errBack) {
  return pubRequire(
    'patch',
    `${base}/collections-likes/${id}/pass`,
    {},
    callBack,
    errBack
  )
}
// 审核不通过
export function reviewedFail(id, callBack, errBack) {
  return pubRequire(
    'patch',
    `${base}/collections-likes/${id}/unpass`,
    {},
    callBack,
    errBack
  )
}
